/**
 * Created by Administrator on 2015/12/12.
 */
Search_Suggestion_Ajax = (function($){
    function Search_Suggestion_Ajax(el, opts){
        if (typeof(opts) != "object") opts = {};
        $.extend(this, opts);
        this.input = $(el);
        this.init_val = opts["init_val"];
        this.build();
    };
    Search_Suggestion_Ajax.prototype = {
        build: function(){
            var items = "";
            $(this.init_val).each(function() {
                items += ('<li class="Item">'+this+'</li>')
            });
            var ul_item = $('<ul></ul>').append(items);
            var search_suggestion = $('<div class="Search_Suggestion_Ajax"></div>').append(ul_item);
            this.final = $('<div class="Search_Suggestion_Ajax"></div>').append(search_suggestion).insertAfter(this.input);
/*
*  ajax未完成
*  show（），hide（）未完成
* */
        }

    };
    $.fn.search_suggestion = function(opts) {
        return this.each(function() {
            new Search_Suggestion_Ajax(this, opts)
        })
    };
    $.date_input = {
        initialize: function(opts) {
            $("input.test").search_suggestion(opts)
        }
    };
    return Search_Suggestion_Ajax
})(jQuery);